From e61c1245096e46fda3385afa5c0dcd8e3574d51f Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Mon, 8 Jul 2013 13:13:23 -0400 Subject: [PATCH] Deprecate and hardcode values for gtk-tooltip* timeouts --- gtk/gtksettings.c | 6 ++++++ gtk/gtkstatusicon.c | 2 +- gtk/gtktooltip.c | 19 ++++++------------- gtk/gtkwidget.c | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 112bf732e4..ceaec85ec4 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -773,6 +773,8 @@ gtk_settings_class_init (GtkSettingsClass *class) * cursor is hovering on top of a widget. * * Since: 2.12 + * + * Deprecated: 3.10: This setting is ignored. */ result = settings_install_property_parser (class, g_param_spec_int ("gtk-tooltip-timeout", @@ -799,6 +801,8 @@ gtk_settings_class_init (GtkSettingsClass *class) * for the new object. * * Since: 2.12 + * + * Deprecated: 3.10: This setting is ignored. */ result = settings_install_property_parser (class, g_param_spec_int ("gtk-tooltip-browse-timeout", @@ -821,6 +825,8 @@ gtk_settings_class_init (GtkSettingsClass *class) * about browse mode. * * Since: 2.12 + * + * Deprecated: 3.10: This setting is ignored. */ result = settings_install_property_parser (class, g_param_spec_int ("gtk-tooltip-browse-mode-timeout", diff --git a/gtk/gtkstatusicon.c b/gtk/gtkstatusicon.c index c4b0bb4b97..3e3b92a48b 100644 --- a/gtk/gtkstatusicon.c +++ b/gtk/gtkstatusicon.c @@ -605,7 +605,7 @@ gtk_status_icon_class_init (GtkStatusIconClass *class) * @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard * @tooltip: a #GtkTooltip * - * Emitted when the #GtkSettings:gtk-tooltip-timeout has expired with the + * Emitted when the hover timeout has expired with the * cursor hovering above @status_icon; or emitted when @status_icon got * focus in keyboard mode. * diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 311dfbdc9f..7892ef0608 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -109,6 +109,9 @@ #undef DEBUG_TOOLTIP +#define HOVER_TIMEOUT 500 +#define BROWSE_TIMEOUT 60 +#define BROWSE_DISABLE_TIMEOUT 500 #define GTK_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLTIP, GtkTooltipClass)) #define GTK_IS_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLTIP)) @@ -1351,14 +1354,7 @@ gtk_tooltip_hide_tooltip (GtkTooltip *tooltip) if (!tooltip->keyboard_mode_enabled) { - guint timeout; - GtkSettings *settings; - - settings = gtk_widget_get_settings (GTK_WIDGET (tooltip->window)); - - g_object_get (settings, - "gtk-tooltip-browse-mode-timeout", &timeout, - NULL); + guint timeout = BROWSE_DISABLE_TIMEOUT; /* The tooltip is gone, after (by default, should be configurable) 500ms * we want to turn off browse mode @@ -1414,7 +1410,6 @@ gtk_tooltip_start_delay (GdkDisplay *display) { guint timeout; GtkTooltip *tooltip; - GtkSettings *settings; tooltip = g_object_get_data (G_OBJECT (display), "gdk-display-current-tooltip"); @@ -1425,12 +1420,10 @@ gtk_tooltip_start_delay (GdkDisplay *display) if (tooltip->timeout_id) g_source_remove (tooltip->timeout_id); - settings = gtk_widget_get_settings (GTK_WIDGET (tooltip->window)); - if (tooltip->browse_mode_enabled) - g_object_get (settings, "gtk-tooltip-browse-timeout", &timeout, NULL); + timeout = BROWSE_TIMEOUT; else - g_object_get (settings, "gtk-tooltip-timeout", &timeout, NULL); + timeout = HOVER_TIMEOUT; tooltip->timeout_id = gdk_threads_add_timeout_full (0, timeout, tooltip_popup_timeout, diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 8a3b0a0865..f2a7005575 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -3237,7 +3237,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS * @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard * @tooltip: a #GtkTooltip * - * Emitted when #GtkWidget:has-tooltip is %TRUE and the #GtkSettings:gtk-tooltip-timeout + * Emitted when #GtkWidget:has-tooltip is %TRUE and the hover timeout * has expired with the cursor hovering "above" @widget; or emitted when @widget got * focus in keyboard mode. * -- 2.30.2